package com.matt.controller.pad;

import com.matt.domain.NurseVideo;
import com.matt.foundation.constant.RequestConstant;
import com.matt.foundation.model.MemVerificationCache;
import com.matt.commons.model.StatusResponse;
import com.matt.commons.page.PagerQuery;
import com.matt.service.NurseVideoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.matt.foundation.constant.RequestConstant.TICKET;


@RestController
@RequestMapping("/pad/nurseVideo")
@Slf4j
public class PadNurseVideoController {

    @Autowired
    private NurseVideoService nurseVideoService;

    @Autowired
    private MemVerificationCache cache;




    @RequestMapping("/getPage")
    public StatusResponse page(@RequestHeader(TICKET) String ticket, PagerQuery query){
        Page<NurseVideo> recordPage = nurseVideoService.getPageList(query.getPageNum(), query.getPageSize());
        return StatusResponse.success(recordPage);
    }



    @RequestMapping("/detail")
    public StatusResponse deleteNotice(@RequestHeader(RequestConstant.TICKET) String ticket, String videoId) {
        NurseVideo video =  nurseVideoService.getById(videoId);
        return StatusResponse.success(video);
    }




}
